task_path = ../task/
oj_path = ../oj/
utility_path = ../utility/
proxy_path = ../proxy/
html_parser_path = ../html_parser/
threadpoll_path = ../threadpoll/

CFLAGS = -I$(utility_path) -I$(oj_path) -I$(task_path) -I$(task_path) -I$(html_parser_path)
LIBS   = -lcurl -lpython2.7

GVJ		= $(utility_path)gvj.cpp
HDU		= $(oj_path)hdu.cpp
HDU_PARSER = $(html_parser_path)hdu_parser.cpp
ALL_OBJ	= test.o gvj.o hdu.o hdu_handler.o hdu_parser.o


main: $(ALL_OBJ)
	g++ $(ALL_OBJ) -o main $(LIBS)
	make clean
test.o: test.cpp
	g++ -c test.cpp -o test.o $(CFLAGS)

gvj.o: $(GVJ)
	g++ -c $(GVJ) -o gvj.o $(CFLAGS)

hdu_handler.o: hdu_handler.cpp
	g++ -c hdu_handler.cpp -o hdu_handler.o $(CFLAGS) 
hdu.o: $(HDU)
	g++ -c $(HDU) -o hdu.o $(CFLAGS)
hdu_parser.o: $(HDU_PARSER)
	g++ -c $(HDU_PARSER) -o hdu_parser.o $(CFLAGS)










#test: test.cpp pojhandler.o poj.o
#	g++ test.cpp pojhandler.o poj.o -o test $(CFLAGS) $(LIBS)

pojhandler.o: pojhandler.cpp 
	g++ -c pojhandler.cpp -o pojhandler.o $(CFLAGS) $(LIBS)

poj.o: $(oj_path)poj.cpp
	g++ -c $(oj_path)poj.cpp -o poj.o $(CFLAGS)

clean:
	rm -v *.o
